@{
   
    //Layout = "~/Views/Shared/_3ColumnMasterLayout.cshtml";

    Layout = null;


    string url = string.Empty; //HttpUtility.UrlDecode(this.Request.QueryString.Get("u"));
    string title = string.Empty; // this.Request.QueryString.Get("t");

    title = HttpUtility.UrlDecode(title);
    title = title.Replace("-", " ");
    title = title.Replace("+", " ");
    ViewBag.Title = title + " | Lookatnews.com";


    string feedid = this.Request.QueryString.Get("id");

    NewsMine.DomainObjects.FeedItem feedItem = null;

    if(!string.IsNullOrEmpty(feedid))
    {
        feedid = feedid.Trim();
        
        if (WebApp1.Controllers.HomeController.CachedFeedItems.ContainsKey(feedid))
        {
            bool isFeedAvailableInCache =   WebApp1.Controllers.HomeController.CachedFeedItems.TryGetValue(feedid, out feedItem);
        }

        if (feedItem == null)
        {
            feedItem = NewsDiscoveryEngine.FeedIndexSearcher.Instance.GetFeedById(Convert.ToInt64(feedid));

            if (feedItem != null)
            {
                if (!WebApp1.Controllers.HomeController.CachedFeedItems.ContainsKey(feedid))
                {
                    WebApp1.Controllers.HomeController.CachedFeedItems.TryAdd(feedItem.ID, feedItem);
                }
            }
        }
    }

    if(feedItem==null)
    {
        if(this.Request.UrlReferrer!=null)
        {
            Response.Redirect(this.Request.UrlReferrer.ToString());
        }
        else
        {
            Response.Redirect("http://www.lookatnews.com/?ref=nofeeditem");
        }
        return;
    }

    url = HttpUtility.UrlDecode(HttpUtility.HtmlDecode(feedItem.Link));
    //url = feedItem.Link;
    
    ViewBag.Title = feedItem.Title + " | Lookatnews.com";
    
    if(string.IsNullOrEmpty( feedItem.Description))
    {
        ViewBag.Description = feedItem.Title;
    }
    else
    {
        ViewBag.Description = feedItem.Description;
    }
    
    ViewBag.Image = feedItem.ImageUrl;    
    
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="robots" content="noindex,nofollow" />
    <title>@ViewBag.Title</title>
    <meta name="description" content="@ViewBag.Description" />
    @if (!string.IsNullOrEmpty(ViewBag.Image))
    {
        <link rel="image_src" href="@ViewBag.Image" />
    }
    <style type="text/css">
        body
        {
            margin: 0;
            padding-left: 0px !important; /* When using the navbar-top-fixed */
            padding-right: 0px !important; /* When using the navbar-top-fixed */
            font-family: 'Open Sans Condensed' , sans-serif;
        }
        
        b
        {
            font-size: 110%;
        }
        em
        {
            color: red;
        }
        
        #maincontainer
        {
            background-color: White;
            padding-top: 0px;
            width: 1100px; /*Width of main container*/
            margin: 0 auto; /*Center container on page*/
        }
        
        #topsection
        {
            background: #FFF;
            height: 100px; /*Height of top section*/
            padding-bottom: 5px;
            border-bottom: 2px double #3B5998;
            margin-bottom: 20px;
        }
        
        #topsection h1
        {
            margin: 0;
            padding-top: 15px;
        }
        
        #contentwrapper
        {
            float: left;
            width: 100%;
        }
        
        .navBarDir
        {
            top: 10px;
            float: right;
            position: relative;
        }
        
        .navBarDir Ul
        {
            list-style: none outside none;
        }
        .navBarDir ul li
        {
            display: inline;
            padding-left: 5px;
            padding-right: 5px;
            border-right: 2px solid #F0F0F0;
        }
        
        #contentcolumn
        {
            padding-left: 10px;
            padding-right: 10px;
            margin: 0 362px 0 180px; /*Margins for content column. Should be "0 RightColumnWidth 0 LeftColumnWidth*/
            background-color: #FFF;
            border-left: 1px solid lightgrey;
            border-right: 1px solid #F4F4F4;
        }
        
        
        
        #leftcolumn
        {
            line-height: 30px;
            float: left;
            width: 180px; /*Width of left column in pixel*/
            margin-left: -1100px; /*Set margin to that of -(MainContainerWidth)*/
            background: #FFF;
            color: #000;
            font-family: Arial;
            font-size: 13px;
        }
        
        #leftcolumn a
        {
            text-decoration: none;
            color: #000;
        }
        
        
        
        #rightcolumn
        {
            float: right;
            width: 362px; /*Width of right column*/
            margin-left: -362px; /*Set left margin to -(RightColumnWidth)*/
            background: #FFF;
            border-left: 0px solid lightgrey;
        }
        
        #footer
        {
            clear: left;
            width: 100%;
            background: black;
            color: #FFF;
            text-align: center;
            padding: 4px 0;
        }
        
        #footer a
        {
            color: #FFFF80;
        }
        
        .innertube
        {
            margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/
            margin-top: 0;
        }
    </style>
    <link href="@Url.Content("~/content/css/bootstrap.css")" rel="stylesheet">
    <link href="@Url.Content("~/content/css/bootstrap-responsive.css")" rel="stylesheet">
    <link rel='stylesheet' href='@Url.Content("~/content/PinStyle1.css")' media='screen' />
    <link href='http://fonts.googleapis.com/css?family=Baumans' rel='stylesheet' type='text/css'>
    <style>
        body
        {
            padding-top: 0px; /* 60px to make the container go all the way to the bottom of the topbar */
        }
    </style>
    <script src="@Url.Content("~/content/js/jquery.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/content/js/bootstrap.js")"></script>
    <script src="@Url.Content("~/content/js/jquery.timeago.js")"></script>
    <script src="@Url.Content("~/content/js/jquery.lazyload.js")"></script>
    <script type="text/javascript">

        window.onresize = function () {
            resizeIframe();
        }

        jQuery(document).ready(function ($) {

            //$('iframe').attr('src', getIframeUrl());
            resizeIframe();
        });
        function resizeIframe() {
            $("#iframe").height(WindowHeight() - getObjHeight(document.getElementById("topBar")));
        }

        function getIframeUrl() {
            var url = window.location.href;
            //alert("before decode" + url);
            url = decodeURIComponent(url.replace(/\+/g, " "));
            //alert("after decode" + url);

            var iframe_url = 'http://www.lookatnews.com/';
            var param_start = url.indexOf("url=");
            if (param_start != -1)
                iframe_url = url.substr(param_start + 7 - 3, url.length - param_start - 7 + 3);
            //alert(iframe_url);
            if (iframe_url.indexOf("http://") == -1)
                iframe_url = "http://" + iframe_url;
            //alert(iframe_url);
            return iframe_url;
        }

        function WindowHeight() {
            var de = document.documentElement;
            return self.innerHeight ||
		(de && de.clientHeight) ||
		document.body.clientHeight;
        }

        function getObjHeight(obj) {
            if (obj.offsetWidth) {
                return obj.offsetHeight;
            }
            return obj.clientHeight;
        }


        function encode() {
            var obj = document.getElementById('dencoder');
            var unencoded = obj.value;
            obj.value = encodeURIComponent(unencoded).replace(/'/g, "%27").replace(/"/g, "%22");
        }

        function decode(encoded) {
            //	        var obj = document.getElementById('dencoder');
            //	        var encoded = obj.value;
            return decodeURIComponent(encoded.replace(/\+/g, " "));
        }


    </script>
</head>
<body style="background-color: rgb(239, 240, 255); width: 100%; margin: auto; margin-top: 49px;
    text-align: center;">
    <div id="topBar" style="width: 100%; height: 50px; background-color: White; border-bottom: 1px solid #ccc;
        overflow: hidden;" class="navbar-fixed-top">
        <div style="min-width: 1100px;">
            <div class="pull-left" style="background-color: #fff; width: 370px; height: 90px;
                margin-left: 10px;">
                <a href="/" title="lookatnews.com">
                    <img src="@Url.Content("~/content/img/lookatnews_final_logo.png")"  style="height:50px;margin:2px;;"/>
                </a>
            </div>
            <a class="btn-link" target="_parent" href="@url">Direct Link</a>
            <div style="width: auto; background-color: #FEFEFE; margin-top: 0px;" class="pull-right">
                <form class="navbar-search" action="/Search" style="margin-top: 10px; margin-right: 10px;">
                <div class="input-append">
                    <input type="text" name="q" class=" input-xlarge" placeholder="Search news from here...">
                    <button type="submit" class="btn btn-primary" style="height: 30px">
                        <li class="icon-search icon-white"></li>
                    </button>
                </div>
                </form>
            </div>
        </div>
    </div>
    <div style="top: 50px; left: 0px; height: 100%; width: 100%; overflow: hidden;">
        <iframe id="iframe" src="@url" frameborder="0" noresize="noresize" style="background-color:White;position:absolute;width:100%;height:100%;top:50px;padding:0;left:0px;" >
        </iframe>
    </div>
    @RenderPage("_googleAnalytics.cshtml")
</body>
</html>
